import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/Home/Home.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),

  routes: [
    { path: '/', redirect:'/manager/home' },
    { path: '/manager', component: () => import('../views/Manager/Manager.vue'),
      children:[
        {path: 'home', meta:{name:'首页'}, component: () => import('../views/Home/Home.vue'),},
        {path: 'admin', meta:{name:'管理员信息'}, component: () => import('../views/Admin/Admin.vue'),},
        {path: 'user', meta:{name:'用户信息'}, component: () => import('../views/User/User.vue'),},
        {path: 'gerenxinxi', meta:{name:'个人信息'}, component: () => import('../views/Gerenxinxi/Gerenxinxi.vue'),},
        {path: 'shangpinfenlei', meta:{name:'商品分类'}, component: () => import('../views/Shangpinfenlei/Shangpinfenlei.vue'),},
        {path: 'shangpinxiangqing', meta:{name:'商品详情'}, component: () => import('../views/Shangpinxiangqing/Shangpinxiangqing.vue'),},
        {path: 'dingdanguanli', meta:{name:'订单管理'}, component: () => import('../views/Dingdanguanli/Dingdanguanli.vue'),},

      ]
    },
    { path: '/login', component: () => import('../views/Login/Login.vue'), },
    { path: '/register', component: () => import('../views/Register/Register.vue'), },
    { path: '/notFound', component: () => import('../views/404/404.vue'), },
    { path: '/:pathMatch(.*)', redirect:'/notFound' },
  ],
})

export default router
